package com.lvfuyang.commonproject.task;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class ExampleTask {

    /**
     * 每小时的50分钟执行，为下一小时生成巡检任务
     */
    @Scheduled(cron = "0 50 * * * ?")
//    @Scheduled(cron = "0/1 * * * * ?")    // 测试，每秒检测
    public void task() {
        System.out.println("定时任务执行时间：" + System.currentTimeMillis());
    }
}
